Table cells can contain
formulas that do calculations using the values in other table cells.
With
a table cell selected, you can insert formulas from the Table toolbar
as well as the shortcut menu. You can also open the In-Place Text
Editor and enter a formula in a table cell manually.
Insert a Formula
In formulas, cells are
referred to by their column letter and row number. For example,
the cell at top left in the table is A1. Merged cells use the number of
what would be the top-left cell. A range of cells is defined by
the first and last cells, with a colon between them. For example,
the range A5:C10 includes cells in rows 5 through 10 in columns
A, B, and C.
A formula must start with an equal sign (=).
The formulas for sum, average, and count ignore empty cells and
cells that do not resolve to a numeric value. Other formulas display
an error (#) if any cell in the arithmetic expression is empty or
contains nonnumeric data.
Use the Cell option on
the shortcut menu to select a cell in another table in the same
drawing. When you have selected the cell, the In-Place Text Editor opens
so you can enter the rest of the formula. You can also insert a
formula using the Table toolbar.
Copy a Formula
When you copy a formula to another cell in the
table, the range changes to reflect the new location. For example,
if the formula in A10 sums A1 through A9, when you copy it to B10,
the range of cells changes so that it sums B1 through B9.
If you don't want a cell
address to change when you copy and paste the formula, add a dollar
sign ($) to the column or row part of the address. For example,
if you enter $A10, the column stays the same and the row changes. If
you enter $A$10, both column and row stay the same.
Insert Data Automatically
You
can automatically increment data in adjacent cells within a table
by using the AutoFill grip. For example, a table with a date column
can have the dates automatically entered by entering the first necessary
date and dragging the AutoFill grip.
Numbers will fill automatically
by increments of 1 if one cell is selected and dragged. Similarly,
dates will resolve by increments of one day if only one cell is
selected. If two cells are manually filled with dates one week apart,
the remaining cells are incremented by one week.
Show Me: Insert Table Data
Automatically
To add a formula to table
cells
- Select the table cell where you want
to place the formula by clicking inside it. The Table toolbar is
displayed.
- On the Table toolbar, click one of the
following:
- Insert Formula
Average
- Insert Formula
Sum
- Insert Formula
Count
- Insert Formula
Cell
- Follow the prompts.
- Edit the formula, if necessary.
- To save your changes and exit the editor,
click in the drawing outside the editor.
To manually enter a formula
in a table cell
- Double-click inside a table cell.
The In-place Text Editor opens.
- Enter a formula (a function or an arithmetic
expression), as in the following examples:
- =sum(a1:a25,b1).
Sums the values in the first 25 rows of column A and the first row
in column B.
- =average(a100:d100).
Calculates the average of the values in the first 4 columns in row
100.
- =count(a1:m500).
Displays the total number of cells in column A through column M
in rows 1 through 100.
- =(a6+d6)/e1.
Adds the values in A6 and D6 and divides the total by the value
in E1.
Use a colon to define
a range of cells and a comma for individual cells. A formula must
start with an equal sign (=) and can contain any of the following
signs: plus (+), minus (-), times (*), divided by (/), exponent
(^), and parentheses ().
- To save your changes and exit the editor,
click in the drawing outside the editor.
The cell displays the result of the calculation.
To change the background
color of column letters and row numbers for tables
- Click a grid line to select a table.
- Right-click. Click Table Indicator Color.
- In the Select Color dialog box, select
a color.
- Click OK.
The text color, size, and style and the line
color are controlled by the settings for column heads in the current
table style.
To insert a Formula field
in a table cell
- Click inside the table
cell.
- On the Table toolbar,
click Insert Field.
- In the Field dialog
box, Field Category list, select Objects.
- In Field Names, select
Formula.
- To enter a formula, do one of the following:
- Click Average, Sum, or Count. The Field
dialog box closes temporarily. To specify a range, click inside
the first and the last cell. The result is appended to the formula.
- Click Cell. The Field dialog box closes
temporarily. Select a cell in a table in the drawing. The cell address
is appended to the formula.
- (Optional) Select a
format and a decimal separator.
- Click OK.
- To save your changes and exit the editor,
click in the drawing outside the editor.
The cell displays the result of the calculation.
To automatically fill cells
with incremented data
- Double-click inside a table cell.
- Enter a numeric value; for example, 1
or 01/01/2000.
- Press the down arrow and enter the next
desired numeric value.
- On the Text Formatting toolbar, click
OK.
To change the format
of the cell data, right-click the cell. Select Data Format.
- Select the cell or cells from which you
want to increment data from.
- Click the grip in the lower right corner
of the cell or cells.
To change AutoFill options,
right-click the AutoFill grip in the bottom right-hand corner of
the selected cell range and select an AutoFill option.
- Drag the grip through the cells you would
like to automatically increment. A preview of the value for each
cell will display to the right of the selected grip.
CommandsFIELD
Creates
a multiline text object with a field that can be updated automatically as
the field value changes.
MTEXT
Creates a multiline
text object.
TABLE
Creates an empty table
object.
TABLEEXPORT
Exports data from a
table object in CSV file format.
TABLESTYLE
Creates, modifies, or
specifies table styles.
UPDATEFIELD
Manually
updates fields in selected objects in the drawing.
System VariablesCTABLESTYLE
Sets the name of the
current table style.
FIELDDISPLAY
Controls whether fields
are displayed with a gray background.
FIELDEVAL
Controls how fields
are updated.
TABLEINDICATOR
Controls the display
of row numbers and column letters when the In-Place Text Editor
is open for editing a table cell.